﻿using MediatR;
using SheepStorage.API.Application.Command.SheepMomHistoryCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepMomHistoryHandler
{
    public class DelSheepMomHistoryCommandHandler : IRequestHandler<DelSheepMomHistoryCommand, Results<int>>
    {
        ISheepMomHistoryService _res;

        public DelSheepMomHistoryCommandHandler(ISheepMomHistoryService res)
        {
            _res = res;
        }

        public async Task<Results<int>> Handle(DelSheepMomHistoryCommand request, CancellationToken cancellationToken)
        {
            var list = await _res.DelSheepMomHistory(request.ids);
            return Results<int>.DataResult(list);
        }
    }
}
